package com.easyedu.student.controller;

import com.easyedu.core.util.R;
import com.easyedu.student.entity.DO.Student;
import com.easyedu.student.service.StudentService;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author lmr </br>
 * 学生信息查询
 **/
@RestController
@RequestMapping("/student")
public class IndexController {

    private final StudentService studentService;

    public IndexController(StudentService studentService) {
        this.studentService = studentService;
    }

    /**
     * 功能描述：获取学生信息
     * 查询的是 学生信息表 student
     *
     * @param studentNumber 学号
     * @return
     */
    @GetMapping("/index")
    public R index(@RequestParam("studentNumber") Long studentNumber) {
        Student studentInfo = studentService.index(studentNumber);
        return R.ok().data(studentInfo);
    }
}
